#include "Timer.h"
#include <SDL.h>

// This is the better version of the timer class

Timer::Timer()
{
	m_dt = 0;
	m_previousTicks= 0;
}

Timer::~Timer()
{

}

void Timer::Update()
{
	int ticksThisFrame = SDL_GetTicks();

	int diff = ticksThisFrame - m_previousTicks;

	m_dt = (float)diff / 1000.0f;

	m_previousTicks = SDL_GetTicks();
}

float Timer::GetDT() const
{
	return m_dt;
}